<?php

declare(strict_types=1);

namespace app\validate;

use think\Validate;

class Theme extends Validate
{
    protected $rule =   [
        'name'   => 'require|max:50',
        'dept_id' => 'require|number',
        'status' => 'require',
        'openness' => 'require',
    ];

    protected $message  =   [
        'name.require' => '主题名称不能为空',
        'name.max' => '主题名称最多不能超过50个字符',
        'dept_id.require' => '请选择部门',
        'dept_id.number' => '部门选择有误',
        'status.require' => '请选择主题状态',
        'openness.require' => '请选择主题属性'
    ];

    protected $scene = [
        'add'  =>  ['name', 'dept_id', 'status', 'openness'],
    ];
}
